﻿using System;
using System.Linq;
using TeamFranceTriple.Config;

namespace TeamFranceTriple
{
    public partial class NextUserBirthday : BaseUserControl
    {
        private Int32 MaxUser = TeamFranceTripleConfig.WebConfig.NextUserBirthday.MaxNumberOfUser;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (ThisMaster.Requester.Roles.Contains("Member"))
                this.Visible = true;
            else
            {
                this.Visible = false;
                return;
            }

            NextUserBirthdayObjectDataSource.SelectParameters["MaximumNumberOfUsersToReturn"].DefaultValue = MaxUser.ToString();
            TodayBirthDayBulletedList.DataBind();
            HappyBirthdayLabel.Visible = (TodayBirthDayBulletedList.Items.Count > 0);
        }
    }
}